package cxydmmszl.chapter08.t133;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * <li style="color: red;">Prob</li>
 * 数组中子数组的最大累乘积
 * <li style="color: red;">Desc</li>
 *
 * <li style="color: red;">Link</li> CD32
 *
 * @author habitplus
 * @since 2021-09-06 11:36
 */
public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(bf.readLine());
        double[] arr = new double[n];
        String[] ss = bf.readLine().split(" ");

        for (int i = 0; i < n; i++) {
            arr[i] = Double.parseDouble(ss[i]);
        }
        bf.close();

        double ans = maxProduct(arr);
        System.out.printf("%.2f\n", ans);
    }

    public static double maxProduct(double[] arr) {
        if (arr == null || arr.length == 0) {
            return 0;
        }

        double max = arr[0];
        double min = arr[0];
        double res = arr[0];
        double minEnd = 0;
        double maxEnd = 0;

        for (int i = 1; i < arr.length; i++) {
            maxEnd = max * arr[i];
            minEnd = min * arr[i];
            max = Math.max(Math.max(maxEnd, minEnd), arr[i]);
            min = Math.min(Math.min(maxEnd, minEnd), arr[i]);
            res = Math.max(max, res);
        }

        return res;
    }
}
